<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2023/6/25
 * Time: 9:15
 */
namespace app\index\controller;

use app\index\service\ExtendService;
use think\facade\Db;

class Text{

    /**
     * @SWG\Swagger(
     * schemes={"https"},
     * host="city-api.hzcarlink.com",
     * basePath="",
     * @SWG\SecurityScheme(securityDefinition="Authorization",type="apiKey",name="Authorization",in="header"),
     * @SWG\Info(
     * title="全国各地考试",
     * version="1.0.0",
     * )
     * )
     */
    public function index(){
        $domain = request()->domain();
        if($domain === 'http://127.0.0.1' || $domain === 'https://127.0.0.1'){
            $swagger=\Swagger\scan(root_path().'/app/');
            $swagger->saveAs(root_path().'public/dist/swagger.json');
            return '文档已更新，链接地址：'.$domain.'/dist/index.html';
        }else{
            return '文档已更新，链接地址：'.$domain.'/dist/index.html';
        }
    }




    public function run(){

    }
}